package com.drojian.demo3;

import android.content.Intent;
import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import com.drojian.demo.R;
import com.drojian.demo3.dataStorage.SQLite.SQLiiteActivity;
import com.drojian.demo3.dataStorage.dataStore.DataStoreActivity;
import com.drojian.demo3.dataStorage.file.FileActivity;
import com.drojian.demo3.dataStorage.mmkv.MMKVActivity;
import com.drojian.demo3.dataStorage.room.RoomActivity;
import com.drojian.demo3.dataStorage.sharedPreferences.SharedPreferenceActivity;


public class DataFragment extends Fragment {


    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.part3_fragment_data, container, false);
        Button file = view.findViewById(R.id.file1);
        Button file2 = view.findViewById(R.id.file2);
        Button file3 = view.findViewById(R.id.file3);
        Button file4 = view.findViewById(R.id.file4);
        Button file5 = view.findViewById(R.id.file5);
        Button file6 = view.findViewById(R.id.file6);
        file.setOnClickListener(v->startActivity(new Intent(getContext(), FileActivity.class)));
        file2.setOnClickListener(v->startActivity(new Intent(getContext(), SharedPreferenceActivity.class)));
        file3.setOnClickListener(v->startActivity(new Intent(getContext(), SQLiiteActivity.class)));
        file4.setOnClickListener(v->startActivity(new Intent(getContext(), MMKVActivity.class)));
        file5.setOnClickListener(v->startActivity(new Intent(getContext(), DataStoreActivity.class)));
        file6.setOnClickListener(v->startActivity(new Intent(getContext(), RoomActivity.class)));

        return view;
    }
    public static DataFragment newInstance() {
        return new DataFragment();
    }
}